<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="central/include :: header('新增工艺')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-centralArtProcess-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">工艺名称：</label>
                <div class="col-sm-8">
                    <input name="name" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">产品类型：</label>
                <div class="col-sm-8">
                    <select name="productTypeId" class="form-control m-b" required>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">权重：</label>
                <div class="col-sm-8">
                    <input name="weight" class="form-control input-number" type="text" >
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">描述：</label>
                <div class="col-sm-8">
                    <textarea name="remark" class="form-control"></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="central/include :: footer" />
    <script th:inline="javascript">

        var prefix = ctx + "central/centralArtProcess"

        $.commonBusiness.getIncrementWeight(prefix)

        $("[name=weight]").inputSpinner();

        $("#form-centralArtProcess-add").validate({
            focusCleanup: true
        });


        $(function(){
            loadProductTypeList()
        })

        //加载产品类型列表数据
        function loadProductTypeList(){
            $.productTypeBusiness.getSimpleList('[name=productTypeId]')
        }

        function submitHandler() {
            if ($.validate.form()) {
                $.operation.insert(prefix, $.common.formToJSON());
            }
        }


    </script>
</body>
</html>